﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace LastfmNet.Models
{
    public class Shout : LastfmModelBase
    {
        public Shout()
        {
            this.Body = string.Empty;
            this.Author = string.Empty;
            this.Date = DateTime.MinValue;
        }

        public Shout(XmlNode shoutNode)
        : this()
        {
            if (shoutNode == null) return;
            this.InitializeFromXmlNode(shoutNode);
        }

        public override void InitializeFromXmlNode(XmlNode node)
        {
            if (node == null) return;
            this.Body = node.GetChildValue("body");
            this.Author = node.GetChildValue("author");
            this.Date = node.GetChildValue("date").ToDateTime();
        }

        public string Body { get; set; }

        public string Author { get; set; }

        public DateTime Date { get; set; }
    }
}
